<?php
function getKolom ($sKant)
{
	$sSQL = "SELECT titel, inhoud, kolom_id FROM `kolom` WHERE `kant`='" . $sKant . "' AND `active`=1 ORDER BY `kolom_id`;";
	$qResult = mysql_query ($sSQL);
	$a_sKolommen = array ();
	
	while ($sResult = mysql_fetch_assoc ($qResult))
	{
/* 		ob_start ();
		if (substr ($sResult['inhoud'], 6, 8) == 'module::')
		{
			$sModule = substr ($sResult['inhoud'], 14, -6);
			$sResult['inhoud'] = '<?php include (\'modules/' . $sModule . '/index.php\') ?>';
		}
		eval (' ?>' . $sResult ['inhoud'] . '<?php ');
		$sResult ['inhoud'] = ob_get_contents ();
		ob_end_clean (); */

		$sResult ['inhoud'] = preg_replace_callback ($_SESSION['config']['sModuleRegex'], 'cFunctions::includeModule', $sResult ['inhoud']);
		
		if ($sKant == 'o')
		{
			$a_sKolommen = $sResult ['inhoud'];
		}
		else
		{
			$a_sKolommen[$sResult ['kolom_id']] = array ('titel' => $sResult ['titel'], 'inhoud' => $sResult ['inhoud']);
		}
	}
//	echo '<pre>'; print_r ($a_sKolommen); echo '</pre>';
	return $a_sKolommen;
}
?>
